#ifndef ROUTINGTABLE_H_
#define ROUTINGTABLE_H_

#include <vector>
#include <iostream>
using namespace std;

#define UNREACHABLE -1

class RoutingTable
{
private:
	int myId;
	vector<int> next;
	vector<int> distance;

public:
	RoutingTable(int myId);
	virtual ~RoutingTable();

	// get the next hop on the way to the destination
	int nextHopFor(int destination);

	// get the distance to the destination
	int distTo(int destination);

	/* for each possible target t != myId:
	 * 		a. can all routing msgs to find which neighbour s is closest to t
	 * 		b. update my d[t] := s's d[t] + 1
	* return true if there was any change.
	*/
	bool updateWith(vector<RoutingTable*> routingMsgs);

	//set all entries to unreachable, except myId which is set to 0.
	void reset();
};

ostream& operator<< ( std::ostream& output, RoutingTable& rt);

#endif /*ROUTINGTABLE_H_*/
